﻿using System;
using System.Collections.Generic;
using System.Text;

namespace IllusstraatedCsharp7_ch11_Struct
{
    /*
        类是引用类型，而结构是值类型
        结构是隐式密封的，这意味着不能从它们派生其他结构              
     */
    struct Point
    {
        public int X;
        public int Y;
    }

    class Chapt11_1WhatIsStructure
    {
        static void _Main()
        {
            Point first, second, third;
            first.X = 10;first.Y = 10;
            second.X = 20; second.Y = 20;
            third.X = first.X + second.X;
            third.Y = first.Y + second.Y;

            Console.WriteLine($"first:{first.X},{first.Y}");
            Console.WriteLine($"second:{second.X},{second.Y}");
            Console.WriteLine($"third:{second.X},{second.Y}");
        }
       
    }
}
